import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
//导入全局样式
import './assets/css/global.css'
import './assets/font-awesome-4.7.0/css/font-awesome.css'
//插件使用说明提供的引入方式  引入并在下面注册组件
import TreeTable from 'vue-table-with-tree-grid'

import axios from 'axios'
//配置请求根路径
axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  //在最后必须return config
  return config
})
Vue.prototype.$http = axios

Vue.config.productionTip = false
//插件使用说明提供了引入方式tree-table为自定义的组件名称

Vue.component('tree-table', TreeTable)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
